3.389 \(\int \frac{(d+e x^r)^2 (a+b \log (c x^n))}{x^4} \, dx\)

Optimal. Leaf size=127 \[ -\frac{d^2 \left (a+b \log \left (c x^n\right )\right )}{3 x^3}-\frac{2 d e x^{r-3} \left (a+b \log \left (c x^n\right )\right )}{3-r}-\frac{e^2 x^{2 r-3} \left (a+b \log \left (c x^n\right )\right )}{3-2 r}-\frac{b d^2 n}{9 x^3}-\frac{2 b d e n x^{r-3}}{(3-r)^2}-\frac{b e^2 n x^{2 r-3}}{(3-2 r)^2} \]

[Out]

-(b*d^2*n)/(9*x^3) - (2*b*d*e*n*x^(-3 + r))/(3 - r)^2 - (b*e^2*n*x^(-3 + 2*r))/(3 - 2*r)^2 - (d^2*(a + b*Log[c
*x^n]))/(3*x^3) - (2*d*e*x^(-3 + r)*(a + b*Log[c*x^n]))/(3 - r) - (e^2*x^(-3 + 2*r)*(a + b*Log[c*x^n]))/(3 - 2
*r)

________________________________________________________________________________________

Rubi [A]  time = 0.172924, antiderivative size = 109, normalized size of antiderivative = 0.86, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {270, 2334, 12, 14} \[ -\frac{1}{3} \left (\frac{d^2}{x^3}+\frac{6 d e x^{r-3}}{3-r}+\frac{3 e^2 x^{2 r-3}}{3-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{b d^2 n}{9 x^3}-\frac{2 b d e n x^{r-3}}{(3-r)^2}-\frac{b e^2 n x^{2 r-3}}{(3-2 r)^2} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^4,x]

[Out]

-(b*d^2*n)/(9*x^3) - (2*b*d*e*n*x^(-3 + r))/(3 - r)^2 - (b*e^2*n*x^(-3 + 2*r))/(3 - 2*r)^2 - ((d^2/x^3 + (6*d*
e*x^(-3 + r))/(3 - r) + (3*e^2*x^(-3 + 2*r))/(3 - 2*r))*(a + b*Log[c*x^n]))/3

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \frac{\left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x^4} \, dx &=-\frac{1}{3} \left (\frac{d^2}{x^3}+\frac{6 d e x^{-3+r}}{3-r}+\frac{3 e^2 x^{-3+2 r}}{3-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{-d^2+\frac{6 d e x^r}{-3+r}+\frac{3 e^2 x^{2 r}}{-3+2 r}}{3 x^4} \, dx\\ &=-\frac{1}{3} \left (\frac{d^2}{x^3}+\frac{6 d e x^{-3+r}}{3-r}+\frac{3 e^2 x^{-3+2 r}}{3-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int \frac{-d^2+\frac{6 d e x^r}{-3+r}+\frac{3 e^2 x^{2 r}}{-3+2 r}}{x^4} \, dx\\ &=-\frac{1}{3} \left (\frac{d^2}{x^3}+\frac{6 d e x^{-3+r}}{3-r}+\frac{3 e^2 x^{-3+2 r}}{3-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int \left (-\frac{d^2}{x^4}+\frac{6 d e x^{-4+r}}{-3+r}+\frac{3 e^2 x^{2 (-2+r)}}{-3+2 r}\right ) \, dx\\ &=-\frac{b d^2 n}{9 x^3}-\frac{2 b d e n x^{-3+r}}{(3-r)^2}-\frac{b e^2 n x^{-3+2 r}}{(3-2 r)^2}-\frac{1}{3} \left (\frac{d^2}{x^3}+\frac{6 d e x^{-3+r}}{3-r}+\frac{3 e^2 x^{-3+2 r}}{3-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.300047, size = 127, normalized size = 1. \[ \frac{a \left (-3 d^2+\frac{18 d e x^r}{r-3}+\frac{9 e^2 x^{2 r}}{2 r-3}\right )+3 b \log \left (c x^n\right ) \left (-d^2+\frac{6 d e x^r}{r-3}+\frac{3 e^2 x^{2 r}}{2 r-3}\right )+b n \left (-d^2-\frac{18 d e x^r}{(r-3)^2}-\frac{9 e^2 x^{2 r}}{(3-2 r)^2}\right )}{9 x^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^4,x]

[Out]

(b*n*(-d^2 - (18*d*e*x^r)/(-3 + r)^2 - (9*e^2*x^(2*r))/(3 - 2*r)^2) + a*(-3*d^2 + (18*d*e*x^r)/(-3 + r) + (9*e
^2*x^(2*r))/(-3 + 2*r)) + 3*b*(-d^2 + (6*d*e*x^r)/(-3 + r) + (3*e^2*x^(2*r))/(-3 + 2*r))*Log[c*x^n])/(9*x^3)

________________________________________________________________________________________

Maple [C]  time = 0.244, size = 1930, normalized size = 15.2 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)^2*(a+b*ln(c*x^n))/x^4,x)

[Out]

-1/3*b*(-3*e^2*(x^r)^2*r+2*d^2*r^2-12*d*e*x^r*r+9*e^2*(x^r)^2-9*d^2*r+18*d*e*x^r+9*d^2)/x^3/(-3+2*r)/(-3+r)*ln
(x^n)-1/18*(8*b*d^2*n*r^4-72*b*d^2*n*r^3+486*ln(c)*b*d^2+810*I*Pi*b*d*e*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*
x^r+234*b*d^2*n*r^2-324*b*d^2*n*r-36*a*e^2*r^3*(x^r)^2+270*a*e^2*r^2*(x^r)^2+486*a*d^2+972*a*d*e*x^r+72*I*Pi*b
*d*e*r^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r-108*I*Pi*b*d^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)^2-486*I*Pi*b*d^2
*r*csgn(I*x^n)*csgn(I*c*x^n)^2-486*I*Pi*b*d^2*r*csgn(I*c*x^n)^2*csgn(I*c)+18*I*Pi*b*e^2*r^3*csgn(I*c*x^n)^3*(x
^r)^2-18*I*Pi*b*e^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)^2*(x^r)^2-324*I*Pi*b*e^2*r*csgn(I*x^n)*csgn(I*c*x^n)^2*(x^r)
^2+108*I*Pi*b*d^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+486*I*Pi*b*d^2*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)
-648*a*e^2*r*(x^r)^2+702*a*d^2*r^2-972*a*d^2*r+24*a*d^2*r^4-216*a*d^2*r^3-18*I*Pi*b*e^2*r^3*csgn(I*c*x^n)^2*cs
gn(I*c)*(x^r)^2+162*b*d^2*n+324*b*d*e*n*x^r-36*ln(c)*b*e^2*r^3*(x^r)^2+972*ln(c)*b*d*e*x^r+270*ln(c)*b*e^2*r^2
*(x^r)^2-648*ln(c)*b*e^2*r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810*I*Pi*b
*d*e*r*csgn(I*c*x^n)^2*csgn(I*c)*x^r-432*I*Pi*b*d*e*r^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r)/(-3+2*r)^2/x^
3/(-3+r)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^4,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.39846, size = 1125, normalized size = 8.86 \begin{align*} -\frac{4 \,{\left (b d^{2} n + 3 \, a d^{2}\right )} r^{4} + 81 \, b d^{2} n - 36 \,{\left (b d^{2} n + 3 \, a d^{2}\right )} r^{3} + 243 \, a d^{2} + 117 \,{\left (b d^{2} n + 3 \, a d^{2}\right )} r^{2} - 162 \,{\left (b d^{2} n + 3 \, a d^{2}\right )} r - 9 \,{\left (2 \, a e^{2} r^{3} - 9 \, b e^{2} n - 27 \, a e^{2} -{\left (b e^{2} n + 15 \, a e^{2}\right )} r^{2} + 6 \,{\left (b e^{2} n + 6 \, a e^{2}\right )} r +{\left (2 \, b e^{2} r^{3} - 15 \, b e^{2} r^{2} + 36 \, b e^{2} r - 27 \, b e^{2}\right )} \log \left (c\right ) +{\left (2 \, b e^{2} n r^{3} - 15 \, b e^{2} n r^{2} + 36 \, b e^{2} n r - 27 \, b e^{2} n\right )} \log \left (x\right )\right )} x^{2 \, r} - 18 \,{\left (4 \, a d e r^{3} - 9 \, b d e n - 27 \, a d e - 4 \,{\left (b d e n + 6 \, a d e\right )} r^{2} + 3 \,{\left (4 \, b d e n + 15 \, a d e\right )} r +{\left (4 \, b d e r^{3} - 24 \, b d e r^{2} + 45 \, b d e r - 27 \, b d e\right )} \log \left (c\right ) +{\left (4 \, b d e n r^{3} - 24 \, b d e n r^{2} + 45 \, b d e n r - 27 \, b d e n\right )} \log \left (x\right )\right )} x^{r} + 3 \,{\left (4 \, b d^{2} r^{4} - 36 \, b d^{2} r^{3} + 117 \, b d^{2} r^{2} - 162 \, b d^{2} r + 81 \, b d^{2}\right )} \log \left (c\right ) + 3 \,{\left (4 \, b d^{2} n r^{4} - 36 \, b d^{2} n r^{3} + 117 \, b d^{2} n r^{2} - 162 \, b d^{2} n r + 81 \, b d^{2} n\right )} \log \left (x\right )}{9 \,{\left (4 \, r^{4} - 36 \, r^{3} + 117 \, r^{2} - 162 \, r + 81\right )} x^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^4,x, algorithm="fricas")

[Out]

-1/9*(4*(b*d^2*n + 3*a*d^2)*r^4 + 81*b*d^2*n - 36*(b*d^2*n + 3*a*d^2)*r^3 + 243*a*d^2 + 117*(b*d^2*n + 3*a*d^2
)*r^2 - 162*(b*d^2*n + 3*a*d^2)*r - 9*(2*a*e^2*r^3 - 9*b*e^2*n - 27*a*e^2 - (b*e^2*n + 15*a*e^2)*r^2 + 6*(b*e^
2*n + 6*a*e^2)*r + (2*b*e^2*r^3 - 15*b*e^2*r^2 + 36*b*e^2*r - 27*b*e^2)*log(c) + (2*b*e^2*n*r^3 - 15*b*e^2*n*r
^2 + 36*b*e^2*n*r - 27*b*e^2*n)*log(x))*x^(2*r) - 18*(4*a*d*e*r^3 - 9*b*d*e*n - 27*a*d*e - 4*(b*d*e*n + 6*a*d*
e)*r^2 + 3*(4*b*d*e*n + 15*a*d*e)*r + (4*b*d*e*r^3 - 24*b*d*e*r^2 + 45*b*d*e*r - 27*b*d*e)*log(c) + (4*b*d*e*n
*r^3 - 24*b*d*e*n*r^2 + 45*b*d*e*n*r - 27*b*d*e*n)*log(x))*x^r + 3*(4*b*d^2*r^4 - 36*b*d^2*r^3 + 117*b*d^2*r^2
 - 162*b*d^2*r + 81*b*d^2)*log(c) + 3*(4*b*d^2*n*r^4 - 36*b*d^2*n*r^3 + 117*b*d^2*n*r^2 - 162*b*d^2*n*r + 81*b
*d^2*n)*log(x))/((4*r^4 - 36*r^3 + 117*r^2 - 162*r + 81)*x^3)

________________________________________________________________________________________

Sympy [A]  time = 173.603, size = 235, normalized size = 1.85 \begin{align*} - \frac{a d^{2}}{3 x^{3}} + 2 a d e \left (\begin{cases} \frac{x^{r}}{r x^{3} - 3 x^{3}} & \text{for}\: r \neq 3 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) + a e^{2} \left (\begin{cases} \frac{x^{2 r}}{2 r x^{3} - 3 x^{3}} & \text{for}\: r \neq \frac{3}{2} \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) - \frac{b d^{2} n}{9 x^{3}} - \frac{b d^{2} \log{\left (c x^{n} \right )}}{3 x^{3}} - 2 b d e n \left (\begin{cases} \frac{\begin{cases} \frac{x^{r}}{r x^{3} - 3 x^{3}} & \text{for}\: r \neq 3 \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{r - 3} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq 3 \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + 2 b d e \left (\begin{cases} \frac{x^{r - 3}}{r - 3} & \text{for}\: r - 4 \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} - b e^{2} n \left (\begin{cases} \frac{\begin{cases} \frac{x^{2 r}}{2 r x^{3} - 3 x^{3}} & \text{for}\: r \neq \frac{3}{2} \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{2 r - 3} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq \frac{3}{2} \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + b e^{2} \left (\begin{cases} \frac{x^{2 r - 3}}{2 r - 3} & \text{for}\: 2 r - 4 \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)**2*(a+b*ln(c*x**n))/x**4,x)

[Out]

-a*d**2/(3*x**3) + 2*a*d*e*Piecewise((x**r/(r*x**3 - 3*x**3), Ne(r, 3)), (log(x), True)) + a*e**2*Piecewise((x
**(2*r)/(2*r*x**3 - 3*x**3), Ne(r, 3/2)), (log(x), True)) - b*d**2*n/(9*x**3) - b*d**2*log(c*x**n)/(3*x**3) -
2*b*d*e*n*Piecewise((Piecewise((x**r/(r*x**3 - 3*x**3), Ne(r, 3)), (log(x), True))/(r - 3), (r > -oo) & (r < o
o) & Ne(r, 3)), (log(x)**2/2, True)) + 2*b*d*e*Piecewise((x**(r - 3)/(r - 3), Ne(r - 4, -1)), (log(x), True))*
log(c*x**n) - b*e**2*n*Piecewise((Piecewise((x**(2*r)/(2*r*x**3 - 3*x**3), Ne(r, 3/2)), (log(x), True))/(2*r -
 3), (r > -oo) & (r < oo) & Ne(r, 3/2)), (log(x)**2/2, True)) + b*e**2*Piecewise((x**(2*r - 3)/(2*r - 3), Ne(2
*r - 4, -1)), (log(x), True))*log(c*x**n)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (e x^{r} + d\right )}^{2}{\left (b \log \left (c x^{n}\right ) + a\right )}}{x^{4}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^4,x, algorithm="giac")

[Out]

integrate((e*x^r + d)^2*(b*log(c*x^n) + a)/x^4, x)